package com.leyou.page.handler;


import com.leyou.page.service.GoodsPageService;
import com.leyou.page.vo.BrandVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import top.javatool.canal.client.annotation.CanalTable;
import top.javatool.canal.client.handler.EntryHandler;


@Component
@CanalTable(value = "tb_brand")
public class BrandHandler implements EntryHandler<BrandVO> {

    @Autowired
    private GoodsPageService pageService;

    @Override
    public void insert(BrandVO brandVO) {
        pageService.saveBrandRedis(brandVO);
    }

    @Override
    public void update(BrandVO before, BrandVO after) {
        pageService.saveBrandRedis(after);
    }

    @Override
    public void delete(BrandVO brandVO) {
        pageService.deleteBrandListData(brandVO.getId());
    }
}
